﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace WMM.Tapioca.Linkbase
{
    /// <summary>
    /// XBRL 2.1 Specification 3.5.3
    /// This class is base class for possible extended link elements,
    /// namely locators and resources.
    /// </summary>
    public abstract class ExtendedLinkElement
    {
        private string localName;

        private string namespaceUri;

        /// <returns> The namespace of this extended link element. </returns>
        public string NamespaceUri
        {
            get { return namespaceUri; }
            set { namespaceUri = value; }
        }

        private string label;
 
        private string role;

        private string title;

        private string id;

        private string extendedLinkRole;

        private string documentSource;

        /// <returns> The local name of this extended link element. </returns>
        public string LocalName
        {
            get { return localName; }
            set { localName = value; }
        }

        /// <returns> xlink:label attribute of this extended link element. </returns>
        public string Label
        {
            get
            {
                return label;
            }
            set
            {
                label = value;
            }
        }

        /// <summary>
        /// A field role this Extended Link Element.
        /// </summary>
        public string Role
        {
            get
            {
                return role;
            }
            set
            {
                role = value;
            }
        }

        /// <returns> xlink:title attribute of this extended link element. </returns>
        public string Title
        {
            get
            {
                return title;
            }
            set
            {
                title = value;
            }
        }


        /// 
        /// <returns> true if this element is a locator, false otherwise. </returns>
        public abstract bool IsLocator();

        /// 
        /// <returns> true if this element is a resource, false otherwise. </returns>
        public abstract bool IsResource();

        /// <returns> Extended link role in which this element appears. </returns>
        public string ExtendedLinkRole
        {
            get
            {
                return extendedLinkRole;
            }
            set
            {
                extendedLinkRole = value;
            }
        }


        /// <returns> The ID of this element. </returns>
        public string Id
        {
            get
            {
                return id;
            }
            set
            {
                this.id = value;
            }
        }


        /// <returns> Returns the documentSource. </returns>
        public string DocumentSource
        {
            get
            {
                return documentSource;
            }
        }

        /// <summary>
        /// Constructor empty.
        /// </summary>
        protected ExtendedLinkElement()
        {
   
        }
        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="label">
        ///            Label for this extended link element. </param>
        /// <param name="documentSource">
        ///            Linkbase Source for this extended link element. </param>
        public ExtendedLinkElement(string label, string documentSource)
        {
            this.label = label;
            this.documentSource = documentSource;
        }
    }
}
